let aNode = document.createElement("div");
aNode.style.float="right";
aNode.style.fontSize="200%";
aNode.innerHTML="<a target='mainframe' url='/supplier/obpOrderInquiry/ObpOrderInquiryList.jsp?type=6' id='1405' menuseq='.1105.1430.1405.' menucode='gcwzfds'>供应商电商化订单列表</a>"
document.querySelector("body > div.header-main.\\34 A_hide_div > div").append(aNode);
let timer;
let timerCount = 0;

$("#1405").click(function(){
	timer = setInterval(scanIframe,100);
	if($(this).attr("url")){
		var url = $(this).attr("url") ? $(this).attr("url") : "";
		setIFrame(url);
		var menuSeq = $(this).attr("menuSeq").split(".");
		initialPositionbar();
		for(var i = 0; i<menuSeq.length; i++){
			if(menuSeq[i] != ""){
				setPositionbar(document.getElementById(menuSeq[i]).firstChild.data, document.getElementById(menuSeq[i]).href);

			}
		}
		removeNavImg();
	}
})

function scanIframe(){
	let zq_lc;
	timerCount++;
	console.log("xxxxxx" + timerCount)
	try{
		zq_lc = document.getElementById("mainframe").contentWindow.document.getElementById("iframeId").contentWindow.document.getElementById("listContent").contentWindow;
	}catch(e){
	}
	
	if(!zq_lc || timerCount>5000){
		console.log("yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy")
		clearInterval(zq_lc);
		window.location.href="http://www.tower.com.cn/pshop/v2/stage/front/#/EcomPurchase/commodityOrder"
	}
}





